package quartz.demo1;

import java.util.Calendar;
import java.util.Hashtable;
import java.util.Map;

import org.quartz.Job;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * 要被执行的任务类
 * @author TQ
 *
 */
public class RequestJobUrl implements Job {
	public static Map<String, Map<String, Object>> jobRunningData = new Hashtable<String, Map<String, Object>>();

	public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
		exeJobUrl(jobExecutionContext.getJobDetail());
	}

	public static void exeJobUrl(JobDetail jobDetail) {
		String key = jobDetail.getKey().getName()+jobDetail.getKey().getGroup();
		Map<String, Object> jobMap = jobRunningData.get(key);
		System.out.println(key+":"+Calendar.getInstance().getTime().toLocaleString()+ "★★★★★★★★★★★");  
//		//http远程调用
//		//HttpClient.requestOtherProject((String) jobMap.get("requestUrl"));
//		jobMap.put("requestTimes", (Integer) jobMap.get("requestTimes") + 1);
	}
}
